program B;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils;

var
  f, g: TextFile;
  answer: String;
  T: Word;
  X, Y: Integer;

procedure ReadData;
begin
  Readln(f, X, Y);
end;

procedure ProcessData;
var
  i: Integer;
begin
  answer := '';
  if (X <> 0) then
    for i := 1 to abs(X) do
      if X > 0 then
        answer := answer + 'WE'
      else
        answer := answer + 'EW';
  if (Y <> 0) then
    for i := 1 to abs(Y) do
      if Y > 0 then
        answer := answer + 'SN'
      else
        answer := answer + 'NS';
end;


procedure OutputVerdict(casenum: Word);
begin
  writeln(g, 'Case #', casenum, ': ', answer);
end;

var
  i: Word;
  s: String;

begin
  try
    s := ParamStr(1);
    if (s = '') then
       s := 'input.txt';
    AssignFile(f, s);
    Reset(f);
    AssignFile(g, 'output.txt');
    Rewrite(g);
    try
      Readln(f, T);
      for i := 1 to T do begin
        ReadData;
        ProcessData;
        OutputVerdict(i);
      end;
    finally
      CloseFile(f);
      CloseFile(g);
    end;
    writeln('Reading finished');
    Readln;
  except
    on E: Exception do begin
      Writeln(E.ClassName, ': ', E.Message);
      readln;
    end;
  end;
end.
